<div class="content-wrapper">

    <section class="content-header">
        <?=$this->partial('layout/breadcrumb')?>

        <h1 class="pull-right">
            <a href="<?=$this->url('position', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?=$this->translate('添加仓位')?></a>
            <?=$this->HelpUrl('positionList')?>
        </h1>

    </section>

    <section class="content">
        <?=$this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <div class="box erp-box">

                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="erp-bg-thead">
                                <th>ID</th>
                                <th><?=$this->translate('仓位号')?></th>
                                <th><?=$this->translate('所在仓库')?></th>
                                <th width="18%"><?=$this->translate('操作')?></th>
                            </tr>
                            </thead>

                            <?php if($this->positions) foreach ($this->positions as $position) { ?>
                                <tr>
                                    <td><?= $position->getPositionId()?></td>
                                    <td><?= $this->escapeHtml($position->getPositionSn())?></td>
                                    <td><?= $this->escapeHtml($position->getWarehouse()->getWarehouseName() . ' [' . $position->getWarehouse()->getWarehouseSn() . ']')?></td>
                                    <td>
                                        <a href="<?= $this->url('position',
                                            ['action'=>'edit', 'id'=>$position->getPositionId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?=$this->translate('编辑')?>
                                        </a>

                                        <a href="<?= $this->url('position', ['action'=>'delete', 'id'=>$position->getPositionId()], ['query' => ['qToken' => $this->adminHelper()->getCsrfValue()]]); ?>" onclick="return window.confirm('<?php echo $this->translate('您确实要删除该仓位吗？'); ?>');" class="btn btn-xs btn-danger">
                                            <i class="fa fa-trash"></i> <?=$this->translate('删除')?>
                                        </a>

                                    </td>
                                </tr>
                            <?php } ?>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                    <?=$this->paginationControl($this->positions, 'Sliding', 'layout/page', ['route' => 'position']); ?>
                    </div>
                </div>

            </div>
        </div>

    </section>
</div>